<?php

use App\Middleware\JwtMiddleware;
use Hyperf\HttpServer\Router\Router;
use App\Controller\AuthController;
use App\Controller\GroupController;
use App\Controller\GroupUserController;

Router::post('/register',[AuthController::class, 'register']);
Router::post('/login',[AuthController::class, 'login']);
Router::get('/logout',[AuthController::class, 'logout']);

Router::addGroup('',function (){
    Router::get('/me', [AuthController::class, 'me']);

    Router::get('/groups', [GroupController::class, 'index']);
    Router::post('/groups', [GroupController::class, 'store']);

    Router::post('/group/{group_id}/group_users', [GroupUserController::class, 'store']);

}, ['middleware' => [JwtMiddleware::class]]);